// const superagent = require('superagent');
// jsdom

var Crawler = require("crawler");
// var server = require("./server");

var url = 'https://tyrz.gd.gov.cn/tif/sso/static/?client_id=szjxgcxt&redirect_uri=https%3A%2F%2Famr.sz.gov.cn%2Fpsout%2Fjsp%2Fgcloud%2Fpubservice%2Fuserstsso%2Fgodeal.jsp&response_type=code&scope=all&service=initService';
// var url = 'https://www.baidu.com'
var c = new Crawler({
  maxConnections : 10,
  // This will be called for each crawled page
  callback : function (error, res, done) {
      if(error){
          console.log(error);
      }else{
          var $ = res.$;
          
          // $ is Cheerio by default
          //a lean implementation of core jQuery designed specifically for the server
          console.log($.html());
          // console.log($.load($.html()));
          
          // $('.login-tab').each(function(i, ele){
          //   console.log('ele', ele);
          //   console.log('i', i);
          // })
          
      }
      done();
  }
});

c.queue(url);
// c.queue({
//   uri:"http://www.baidu.com",
//   parameter1:"测试",
// });


 
// var url = "http://v.163.com/special/opencourse/englishs1.html"

